import { ArticleDetail } from '@/types/data'
import { ArticleAction } from '@/types/store'
type ArticleType = {
  info: ArticleDetail
}
const initValue: ArticleType = {
  info: {} as ArticleDetail,
}
export default function article(state = initValue, action: ArticleAction) {
  if (action.type === 'article/setArticleInfo') {
    return {
      ...state,
      info: action.payload,
    }
  }
  return state
}
